1. Field of the Invention
The present invention relates to an image correction method, an image correction device, and a recording medium and, particularly, to an image correction method for correcting at least one of a color of an image or a density of an image, an image correction device capable of applying the image correction method, and a recording medium for recording a program for executing the image correction method using a computer.
2. Description of the Related Art
There is a need for performing color correction such as adjustment of the white balance and density correction to rationalize the density over the entire image on images filmed with a video camera or on image data obtained from photography using a digital still camera. Image color correction and image density correction processes generally comprise sampling image data for each of a plurality of channels (e.g. R, G, B) and, on the basis of the data obtained for each channel from the sampling, calculating average values for each channel. Then, on the basis of these calculated average values, correction values for color correction and for density correction are obtained and the image data is converted on the basis of the correction values. For example, using the correction values, in the color correction, the average value of the chromaticity is changed to gray, and, in the density correction, the average value of the luminance is changed to an intermediate value (using a figure such as 0.75 for reflective density, and a figure such as 118 when the image data represents the density of each pixel in 8 bits).
Note that image data conversion corresponding to color correction and density correction is frequently carried out using the conversion formulas shown below.                               [                                                                      R                  ′                                                                                                      G                  ′                                                                                                      B                  ′                                                              ]                =                  [                                                                                          k                    r                                    ·                  R                                                                                                                          k                    g                                    ·                  G                                                                                                                          k                    b                                    ·                  B                                                              ]                                    (        1        )                                          [                                                                      R                  ′                                                                                                      G                  ′                                                                                                      B                  ′                                                              ]                =                              [                                                                                k                    r                                                                                                                    k                    g                                                                                                                    k                    b                                                                        ]                    +                      [                                                            R                                                                              G                                                                              B                                                      ]                                              (        2        )            
In the above formulas (1) and (2), (R, G, B) represent image data before correction (namely, the values for the R, G, B of each image pixel), (R′, G′, B′) represent image data after correction, and (kr, kg, kb) represent the conversion coefficients of each channel (corresponding to the conversion values for the color conversion and the density conversion). Formula (1) is the conversion formula for adjusting the gain, while formula (2) is the conversion formula for adjusting the offset. Image data conversion corresponding to color correction and density correction may be carried out using just one of formula (1) and formula (2) or using both formula (1) and formula (2) in combination (known as an affine transformation).
However, the values for each pixel of image data recorded, for example, on an information recording medium by photography using a digital still camera are the digital code values converted (coded) in accordance with the conversion characteristic determined according to the display characteristic which will enable the image to be displayed properly on a display unit (for an example thereof, see FIGS. 1-3). Therefore, the relationship between the digital code values for each pixel of image data and values linear in light intensity such as the reflectivity of the image receptor or the tristimulus values obtained from the reflectivity of the image receptor is not linear as can clearly be seen in FIGS. 1A to 1C.
Note that FIGS. 1A to 1C each show a graph of an example of the image receptor reflectivity/digital code values conversion characteristic (solid line) and the image receptor reflectivity tristimulus values/digital code values conversion characteristic (broken line), wherein the horizontal axis shows the reflectivity of the image receptor or tristimulus values obtained from the reflectivity of the image receptor while the vertical axis shows digital code values (8 bit). FIG. 1A is an example of a real number graph when both the horizontal axis numbers and the vertical axis numbers are real numbers, FIG. 1B is an example of a single logarithm axis graph when the horizontal axis numbers are logarithms and the vertical axis are real numbers, while FIG. 1C is an example of a two logarithm axis graph when both the horizontal axis numbers and the vertical axis numbers are logarithms. Note here that the conversion characteristics in FIGS. 1A to 1C are all determined with consideration given to the characteristics of the display.
Accordingly, if corrections are made to image data as described above, using, for example, formula 1 (this equates to shifting the image data along the vertical axis of the two logarithm axis graph of FIG. 1C), when the corrections are to make the image brighter, then the contrast of the image is greatly increased when seen from the viewpoint of the image receptor reflectivity or the viewpoint of the tristimulus values obtained from the image receptor reflectivity. If the corrections are to make the image darker, then the contrast is greatly reduced when seen from the viewpoint of the image receptor reflectivity or the viewpoint of the tristimulus values obtained from the image receptor reflectivity.
Moreover, if corrections are made to image data as described above, using, for example, formula 2 (this equates to shifting the image data along the vertical axis of the single logarithm axis graph of FIG. 1B), when the corrections are to make the image brighter, then the contrast of the image is id: greatly reduced when seen from the viewpoint of the image receptor reflectivity or the viewpoint of the tristimulus values obtained from the image receptor reflectivity. If the corrections are to make the image darker, then the contrast is greatly increased when seen from the viewpoint of the image receptor reflectivity or the viewpoint of the tristimulus values obtained from the image receptor reflectivity. Thus, the problem arises when carrying out color corrections or density corrections that the image gradation is also changed along with the corrections.
The problem described above is not limited to image data obtained by photography using a digital camera. In fact, the values of each pixel of image data obtained by reading an image recorded on photographic film, for example, also have the problem that the gradation is changed together with the color correction or density correction in the same way as described above. This is because the relationship between the values of each pixel of image data obtained by reading an image recorded on photographic film and the value of the light intensity is not linear due to the characteristic of the amount of exposure of the photographic film/color formation density and the characteristic of the amount of light received by the reading sensor/output signal not being linear.
The present invention was achieved in consideration of the above and it is an object thereof to provide an image correction method, an image correction device, and a recording medium which can perform color correction and density correction of an image without changing the gradation thereof.